<div id="content" class="clearfix">
  <h3><?php echo nl2br($this->title); ?></h3>
  <div class="section">
    <!--<H5 class=border>终端录入</H5>-->
    <p><span class="require">*</span>为必须输入项</p>
<?php $form=$this->beginWidget('ActiveForm', array(
	'id'=>'newlend-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>false,
	),
)); ?>    
<!--    <form enctype="multipart/form-data" action="" method="post" >-->
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="normal">
        <tr>
          <th width="25%" align="left"><?php echo $form->label($model,'purchase_date'); ?></th>
          <td>
<?php  if(Yii::app()->user->checkAccess('MENU2_HYXSLR_WY'))
{
$this->widget('zii.widgets.jui.CJuiDatePicker',array(  
    'attribute'=>'purchase_date',  
    'language'=>'zh_cn',  
    'model'=>$model,  
    'options'=>array(  
        'showAnim'=>'fold',
        'minDate'=>'new Date()',  
        'dateFormat'=>'yy-mm-dd',
    ),  
));
}
else
{
	echo $form->textField($model,'purchase_date',array('size'=>30,'readonly'=>true));
}
?> 
<?php echo $form->error($model,'purchase_date'); ?>
</td>
        </tr>
        <tr>
          <th width="25%" align="left"><?php echo $form->label($model,'depart_code'); ?></th>
          <td id="select">
            <!-- 
            <?php echo $form->dropDownList($model,'depart_code',Depart::model()->getListData(),array('prompt'=>'---------','onfocus'=>'this.defaultIndex=this.selectedIndex;', 'onchange'=>'this.selectedIndex=this.defaultIndex;',)); ?>
            <?php echo $form->error($model,'depart_code'); ?> 
            -->
            <?php echo Depart::model()->getNameByKey($model->depart_code);?>
            <?php echo $form->hiddenField($model,'depart_code')?>
          </td>
        </tr>
        <tr>
          <th align="left">
             <?php echo $form->label($model,'producttype_code'); ?>
             <?php if($model->isAttributeRequired('producttype_code')) echo CHtml::tag('span',array('class'=>'require'),'*')?>
          </th>
          <td id="select">
            <?php echo $form->dropDownList($model,'producttype_code',Producttype::model()->getListDataByUserType('5'),array('prompt'=>'---------','onchange'=>'productTypeChange(\''.$form->getClientId($model,'producttype_code').'\',\''.$form->getClientId($model,'product_id').'\')',)); ?>
            <?php echo $form->error($model,'producttype_code'); ?>
          </td>
        </tr>

        <tr>
          <th align="left">
             <?php echo $form->label($model,'product_id'); ?>
             <?php if($model->isAttributeRequired('product_id')) echo CHtml::tag('span',array('class'=>'require'),'*')?>
          </th>
          <td id="select">
            <?php echo $form->dropDownList($model,'product_id',Product::model()->getListDataByType($model->producttype_code),array('prompt'=>'---------',)); ?>
            <?php echo $form->error($model,'product_id'); ?>
          </td>
        </tr>
        <tr>
          <th align="left">
             <?php echo $form->label($model,'purchase_number'); ?>
             <?php if($model->isAttributeRequired('purchase_number')) echo CHtml::tag('span',array('class'=>'require'),'*')?>
          </th>
          <td><?php echo $form->textField($model,'purchase_number',array('size'=>20,'class'=>'number',));?>
          	  <?php echo $form->error($model,'purchase_number');?>
          </td>
        </tr>
        <tr>
          <th align="left">
             <?php echo $form->label($model,'remark'); ?>
             <?php if($model->isAttributeRequired('remark')) echo CHtml::tag('span',array('class'=>'require'),'*')?>
          </th>
          <td><?php echo $form->textArea($model,'remark',array('size'=>20,'style'=>'width:98%;','rows'=>5,));?>
          	  <?php echo $form->error($model,'remark');?><br />
          </td>
        </tr>
      </table>
      <p class="inquiry">
      	<?php echo CHtml::submitButton('提交',array('class'=>'btn'))?>
      	<?php echo CHtml::resetButton('取消',array('class'=>'btn'))?>
      </p>
<?php $this->endWidget(); ?>
<!--    </form>-->
    <div class="content-link"><?php echo CHtml::link('▲页面顶部','#wrapper');?></div>
    <!--div.section -->
  </div>
  <!--div#content -->
</div>
<!-- div#content end -->
